<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">    
    <title>Test loading a local HTML Document</title>
    <link rel="stylesheet" type="text/css" href="../css/jsUnitStyle.css">
    <script type="text/javascript" src="../app/jsUnitCore.js"></script>
    <script type="text/javascript">

        var uri = 'tests/data/data.html';

        function setUpPage() {
            setUpPageStatus = 'running';
            top.testManager.documentLoader.callback = setUpPageComplete;
            top.testManager.documentLoader.load(uri);
        }

        function setUpPageComplete() {
            if (setUpPageStatus == 'running')
                setUpPageStatus = 'complete';
        }

        function testDocumentGetElementsByTagName() {
            assertEquals(setUpPageStatus, 'complete');
            var buffer = top.testManager.documentLoader.buffer();
            var elms = buffer.document.getElementsByTagName('P');
            assert('getElementsByTagName("P") returned is null', elms != null);
            assert('getElementsByTagName("P") is empty', elms.length > 0);
        }

    </script>
</head>

<body>
<h1>JsUnit Asynchronous Load Tests</h1>

<p>This page tests loading data documents asynchronously. To see them, take a look at the source.</p>
</body>
</html>
